//
//  CollegeStudent.m
//  OC3_继承
//
//  Created by dllo on 15/10/26.
//  Copyright (c) 2015年 dllo. All rights reserved.
//

#import "CollegeStudent.h"

@implementation CollegeStudent


- (NSString *)major
{
    return _major;
}

- (void)setMajor:(NSString *)major
{
    _major = major;
}
- (CGFloat)credit
{
    return _credit;
}
- (void)setCredit:(CGFloat)credit
{
    _credit = credit;
}

- (void)info
{
    [super info];
    NSLog(@"%@ %.2f", _major, _credit);
}


- (id)initWithName:(NSString *)name sex:(NSString *)sex age:(NSInteger)age score:(CGFloat)score major:(NSString *)major credit:(CGFloat)credit
{

   self = [super initWithName:name sex:sex age:age score:score];
    if (self) {
        [self setMajor:major];
        [self setCredit:credit];
    }
    return self;
}

+ (id)CollegeStudentWithName:(NSString *)name sex:(NSString *)sex age:(NSInteger)age score:(CGFloat)score major:(NSString *)major credit:(CGFloat)credit
{
    CollegeStudent *c = [[CollegeStudent alloc] initWithName:name sex:sex age:age score:score major:major credit:credit];
    return c;
}



@end
